#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<ctype.h>
#include<string.h>
int main()
{
	char s[100]; int count =0, flag = 1, i;
	gets(s);
	for (i = 0; i <strlen(s); i++)
	{
		if (s[i] == ' ')flag = 1;
		else if (flag == 1)
		{
			count++;
			flag = 0;
		}
	}
	
	if(s[i]==' ')printf("%d\n", count - 1);
	else printf("%d\n", count);
}
